import React from 'react';
import ReactDOM from 'react-dom/client';
const root = ReactDOM.createRoot(document.getElementById('root'));
function FunctionComponent() {
	const [number, setNumber] = React.useState(0);
	if (number === 0) {
		return (
			<div  key="title1" id='title1'  onClick={() => setNumber(number + 1)}>
				title1
			</div>
		)
	}
	//更新后只有一个节点
	return (
		<div key="title2" id='title2' >
			title2
		</div>
	);
}
root.render(<FunctionComponent />);